home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.midlet.MIDlet;
-
- public class midpman extends MIDlet implements CommandListener {
- private Command exitCommand = new Command("Exit", 1, 1);
- public Command startCommand = new Command("Start", 1, 2);
- public Command pauseCommand = new Command("Pause", 1, 2);
- private Display display = Display.getDisplay(this);
- private mmCanvas myCanvas;
-
- public midpman() {
- this.myCanvas = new mmCanvas(this.startCommand, this.pauseCommand);
- }
-
- public void startApp() {
- this.myCanvas.addCommand(this.exitCommand);
- this.myCanvas.setCommandListener(this);
- this.display.setCurrent(this.myCanvas);
- }
-
- public void pauseApp() {
- }
-
- public void destroyApp(boolean var1) {
- }
-
- public void commandAction(Command var1, Displayable var2) {
- if (var1 == this.exitCommand) {
- this.destroyApp(false);
- ((MIDlet)this).notifyDestroyed();
- } else if (var1 == this.startCommand) {
- this.myCanvas.resume();
- } else {
- this.myCanvas.pause();
- }
-
- }
- }
-